from nonebot import on_command, CommandSession
from datetime import datetime
@on_command('kb', aliases=('kb', 'KB', '查课表','课表'))
async def kb(session: CommandSession):
    f=open('c:\\awesome-bot\\awesome\\plugins\\'+str(session.ctx.user_id)+'.txt',encoding='utf-8')
    kb =eval(f.read())
    now = datetime.now().strftime('%Y-%m-%d')  # 获取当前日期
    now = now.replace('-', '')
    if now not in kb.keys():
        message = "今天没有课，好好自习"
    else:
        ulist = kb[now]
        message = ''
        for m in ulist:
            message = message + '\n' + m
    await session.send(message)
